(function () {
	DateP=function (classname) {
		datep=new init(classname);
		datep.bind();
	}
	
	var addEvent = function(e, f) {
		if (window.attachEvent) {
			addEvent('on' + e, f);
		} else {
			addEventListener(e, f, false);
		}
	}
	
	var init=function (classname) {
		this.els=$(".datepicker");
		$.each(this.els, function(index,ele) {
			$(ele).attr("dpid","dpid"+index);
		});
	}
	init.prototype={
		bind: function() {
			_this = this;
			addEvent('click', function(e) {
				var t = e.target || e.srcElement;
				if (t.dpid != null || t.attributes.dpid != null) {
					alert(t.value);
				}
				else{
					alert("请在文本框点击");
				}
			});
		}
	}
})();
